package Day3;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int x = in.nextInt();
            int[] a = new int[n];
            for(int i = 0;i < n;i++){
                a[i] = in.nextInt();
            }
            int sum = 0;
            int index = 0;
            int max = a[0];
            for(int i = 0;i < n;i++){
                sum += a[i];
                if(a[i] > max){
                    max = a[i];
                    index = i;
                }
            }
            if(max < x){
                int yindex = index;
                while(max < x){
                    max += a[++index];
                }
                System.out.print(yindex+" " + index);
            }else if(max == x){

            }

        }
    }
}